Skip to content

Add use cases for Publish Dataset text settings#422

Open
ekraffmiller wants to merge 6 commits intodevelopfrom
407-add-use-cases-for-publish-dataset-settings
Open

Add use cases for Publish Dataset text settings#422
ekraffmiller wants to merge 6 commits intodevelopfrom
407-add-use-cases-for-publish-dataset-settings

Conversation

@ekraffmiller
Copy link
Contributor

@ekraffmiller ekraffmiller commented Feb 5, 2026

What this PR does / why we need it:

Adds use cases to get info settings from the Dataverse API, that are needed in the Publish Dataset confirmation modal.

Which issue(s) this PR closes:

Is there a release notes or changelog update needed for this change?:

in changelog.md

Additional documentation:

@github-actions github-actions bot added FY26 Sprint 14 FY26 Sprint 14 (2025-12-31 - 2026-01-14) FY26 Sprint 15 FY26 Sprint 15 (2026-01-14 - 2026-01-28) FY26 Sprint 16 FY26 Sprint 16 (2026-01-28 - 2026-02-11) GREI Re-arch GREI re-architecture-related Project: HDV SPA Rollout labels Feb 5, 2026
@ekraffmiller ekraffmiller marked this pull request as ready for review February 6, 2026 15:06
Copilot AI review requested due to automatic review settings February 6, 2026 15:06
@ekraffmiller ekraffmiller moved this to Ready for Review ⏩ in IQSS Dataverse Project Feb 6, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds client support for two Dataverse “info/settings” values needed to populate the Publish Dataset confirmation modal text (custom popup text + disclaimer text).

Changes:

  • Extend DataverseInfoRepository / IDataverseInfoRepository with getters for :DatasetPublishPopupCustomText and :PublishDatasetDisclaimerText.
  • Add two new info-domain use cases to expose these settings to consumers of the package.
  • Add/update unit + integration tests, docs, and changelog entries for the new functionality.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/unit/info/DataverseInfoRepository.test.ts Adds unit tests for the two new repository getters.
test/testHelpers/info/infoHelper.ts Adds helper functions to set the new settings via the admin settings API in integration tests.
test/integration/info/DataverseInfoRepository.test.ts Adds integration tests validating repository behavior when settings exist vs. don’t exist.
src/info/infra/repositories/DataverseInfoRepository.ts Implements the two new settings getters via GET /info/settings/:....
src/info/index.ts Wires and exports new use case instances (currently has a wiring bug for disclaimer text).
src/info/domain/useCases/GetPublishDatasetDisclaimerText.ts New use case wrapping getPublishDatasetDisclaimerText() repository call.
src/info/domain/useCases/GetDatasetPublishPopupCustomText.ts New use case wrapping getDatasetPublishPopupCustomText() repository call.
src/info/domain/repositories/IDataverseInfoRepository.ts Adds the two new repository method signatures.
docs/useCases.md Documents the two new use cases (also touches an existing ContactDTO example line).
CHANGELOG.md Adds changelog entries for the two new use cases.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +4 to +18
export class GetDatasetPublishPopupCustomText implements UseCase<string> {
private dataverseInfoRepository: IDataverseInfoRepository

constructor(dataverseInfoRepository: IDataverseInfoRepository) {
this.dataverseInfoRepository = dataverseInfoRepository
}

/**
* Returns a string containing custom text for the Publish Dataset modal.
*
* @returns {Promise<string>}
*/
async execute(): Promise<string> {
return await this.dataverseInfoRepository.getDatasetPublishPopupCustomText()
}
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new use case doesn’t have a corresponding unit test under test/unit/info/ (other info use cases do). Add tests covering the success path (repository returns text) and error propagation (repository rejects).

Copilot uses AI. Check for mistakes.
Comment on lines 18 to 21
const getPublishDatasetDisclaimerText = new GetApplicationTermsOfUse(dataverseInfoRepository)
const getDatasetPublishPopupCustomText = new GetDatasetPublishPopupCustomText(
dataverseInfoRepository
)
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getPublishDatasetDisclaimerText is instantiated with GetApplicationTermsOfUse, so it will return the application terms instead of the publish disclaimer text. This also means the package export is incorrect for consumers. Instantiate GetPublishDatasetDisclaimerText here (and add the corresponding import) so getPublishDatasetDisclaimerText.execute() calls dataverseInfoRepository.getPublishDatasetDisclaimerText().

Copilot uses AI. Check for mistakes.
Comment on lines +4 to +18
export class GetPublishDatasetDisclaimerText implements UseCase<string> {
private dataverseInfoRepository: IDataverseInfoRepository

constructor(dataverseInfoRepository: IDataverseInfoRepository) {
this.dataverseInfoRepository = dataverseInfoRepository
}

/**
* Returns a string containing the disclaimer text for the Publish Dataset modal.
*
* @returns {Promise<string>}
*/
async execute(): Promise<string> {
return await this.dataverseInfoRepository.getPublishDatasetDisclaimerText()
}
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new use case doesn’t have a corresponding unit test under test/unit/info/ (other info use cases do). Add tests covering the success path (repository returns text) and error propagation (repository rejects).

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests are there in unit/info/DataversInfoRepository.test.ts, not sure why this comment was triggered.

ekraffmiller and others added 3 commits February 6, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY26 Sprint 14 FY26 Sprint 14 (2025-12-31 - 2026-01-14) FY26 Sprint 15 FY26 Sprint 15 (2026-01-14 - 2026-01-28) FY26 Sprint 16 FY26 Sprint 16 (2026-01-28 - 2026-02-11) GREI Re-arch GREI re-architecture-related Project: HDV SPA Rollout

Projects

Status: Ready for Review ⏩

Development

Successfully merging this pull request may close these issues.

Create Use Case to get settings for Publish Dataset

1 participant